Fix magellan serial timeouts under Windows.
(echo -n "internal_styles.c: mkstyle.sh " ; echo style/*.style ; /bin/echo -e '\t./mkstyle.sh > $@ || (rm -f $@ ; exit 1)' ) >> /tmp/dep
echo Edit Makefile and bring in /tmp/dep
-VERSIONU=1_2_1_beta01112004
-VERSIOND=1.2.1_beta01112004
+VERSIONU=1_2_1_beta01152004
+VERSIOND=1.2.1_beta01152004
#VERSIONU=1_2_1
#VERSIOND=1.2.1
int synthesize_shortnames;
int debug_level;
gpsdata_type objective;
+ int verbose_status; /* set by GUI wrappers for status */
} global_options;
extern global_options global_opts;
if (wpt->altitude != unknown_alt) {
way[i]->alt = wpt->altitude;
}
+ if (global_opts.verbose_status) {
+ fprintf(stdout, "%d\r", i*100/n);
+ fflush(stdout);
+ }
i++;
}
if ((ret = GPS_Command_Send_Waypoint(portname, way, n)) < 0) {
for (i = 0; i < n; ++i) {
GPS_Way_Del(&way[i]);
}
+ if (global_opts.verbose_status) {
+ fprintf(stdout, "\r\n");
+ }
xfree(way);
}
}
GetCommTimeouts (comport, &timeout);
- timeout.ReadIntervalTimeout = 10;
- timeout.WriteTotalTimeoutMultiplier = 10;
+ timeout.ReadIntervalTimeout = 100;
+ timeout.ReadTotalTimeoutMultiplier = 100;
+ timeout.ReadTotalTimeoutConstant = 100;
+ timeout.WriteTotalTimeoutMultiplier = 100;
timeout.WriteTotalTimeoutConstant = 1000;
if (!SetCommTimeouts (comport, &timeout)) {
xCloseHandle (comport);
for(;i < size;i++) {
if (ReadFile (comport, &ibuf[i], 1, &cnt, NULL) != TRUE)
break;
- if (ibuf[i] == '\n') break;
+ if (cnt < 1)
+ return NULL;
+ if (ibuf[i] == '\n')
+ break;
}
ibuf[i] = 0;
return ibuf;
-
}
static void
? argv[argn]+2 : argv[++argn];
global_opts.debug_level = atoi(optarg);
break;
+ /*
+ * Undocumented '-vs' option for GUI wrappers.
+ */
+ case 'v':
+ switch(argv[argn][2]) {
+ case 's': global_opts.verbose_status = 1; break;
+ }
+ break;
+
/*
* DOS-derived systems will need to escape
* this as -^^.
{
queue *elem, *tmp;
waypoint *waypointp;
+ int i = 0;
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
waypointp = (waypoint *) elem;
+ if (global_opts.verbose_status) {
+ fprintf(stdout, "%d\r", ++i*100/waypt_ct);
+ fflush(stdout);
+ }
(*cb) (waypointp);
}
+ if (global_opts.verbose_status) {
+ fprintf(stdout, "\r\n");
+ }
}
waypoint *